// 集中存放 路由映射关系 的数据包
// 路径 ---- 组件
// 根据此数据包，动态生成Route，动态生成侧边菜单
import {AreaChartOutlined} from '@ant-design/icons'
import IconDIY from '../components/IconDIY'
import DashBoard from "../views/DashBoard"
import CateList from "../views/Category/list"
import CatePublic from "../views/Category/pub"
import CakeList from "../views/CakeManager/list"
import CakePublic from "../views/CakeManager/pub"
import BannerList from '../views/Banner/list'
import BannerPublic from '../views/Banner/pub'
import BannerEdit from '../views/Banner/edit'
import RoleManager from '../views/System/RoleManager'
import UserManger from '../views/System/UserManger'
import NotFound from '../views/NotFound'
import Welcome from '../views/Welcome'
import Area from '../views/Area/index'

export const adminRoutes = [
  {
    path:'/admin',
    component:Welcome,
    exact:true,
    key:'/admin',
    label:'欢迎页',
    icon:<AreaChartOutlined/>,
    roles:['root','admin','worker'],
    hide:true   //控制侧边菜单显示隐藏
  },
  {
    path:'/admin/dashboard',
    component:DashBoard,
    key:'/admin/dashboard',
    label:'数据统计',
    icon:<AreaChartOutlined/>,
    roles:['root']
    // hide:true   //控制侧边菜单显示隐藏
  },
  {
    path:'/admin/area',
    component:Area,
    key:'/admin/area',
    label:'配送范围',
    icon:<AreaChartOutlined/>,
    roles:['root','admin']
    // hide:true   //控制侧边菜单显示隐藏
  },
  {
    path:'/admin/cate',
    key:'/admin/cate',
    label:'分类管理',
    icon:<IconDIY name='icon-fenlei'/>,
    roles:['root','admin','worker'],
    children:[
      {
        path:'/admin/cate/list',
        component:CateList,
        key:'/admin/cate/list',
        label:'分类列表',
        roles:['root','admin'],
      },
      {
        path:'/admin/cate/pub',
        component:CatePublic,
        key:'/admin/cate/pub',
        label:'分类发布',
        roles:['root','admin','worker'],
      }
    ]
  },
  {
    path:'/admin/banner',
    key:'/admin/banner',
    label:'轮播管理',
    icon:<IconDIY name='icon-lunbotu'/>,
    roles:['root','admin','worker'],
    children:[
      {
        path:'/admin/banner/pub',
        component:BannerPublic,
        key:'/admin/banner/pub',
        label:'轮播发布',
        roles:['root','admin','worker'],
      },
      {
        path:'/admin/banner/list',
        component:BannerList,
        key:'/admin/banner/list',
        label:'轮播列表',
        roles:['root','admin'],
      },
      {
        path:'/admin/banner/edit',
        component:BannerEdit,
        key:'/admin/banner/edit',
        label:'轮播编辑',
        roles:['root','admin'],
        hide:true
      }
    ]
  },
  {
    path:'/admin/cake',
    key:'/admin/cake',
    label:'蛋糕管理',
    icon:<IconDIY name='icon-dangao-shi'/>,
    roles:['root','admin','worker'],
    children:[
      {
        path:'/admin/cake/list',
        component:CakeList,
        key:'/admin/cake/list',
        label:'蛋糕列表',
        roles:['root','admin'],
      },
      {
        path:'/admin/cake/pub',
        component:CakePublic,
        key:'/admin/cake/pub',
        label:'蛋糕录入',
        roles:['root','admin','worker'],
      }
    ]
  },
  {
    path:'/admin/sys',
    key:'/admin/sys',
    label:'系统管理',
    icon:<IconDIY name='icon-guanli1'/>,
    roles:['root'],
    children:[
      {
        path:'/admin/sys/role',
        component:RoleManager,
        key:'/admin/sys/role',
        label:'角色管理',
        roles:['root'],
      },
      {
        path:'/admin/sys/user',
        component:UserManger,
        key:'/admin/sys/user',
        label:'账号管理',
        roles:['root'],
      }
    ]
  },
  {
    path:'/admin/404',
    component:NotFound,
    key:'/admin/404',
    label:'404',
    icon:<AreaChartOutlined/>,
    roles:['root','admin','worker'],
    hide:true   //控制侧边菜单显示隐藏
  },
]